Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scripts): setuptools v71 removed the need for extern #15717

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

ryanthecoder
Copy link
Contributor

@ryanthecoder ryanthecoder commented Jul 19, 2024

Overview

Version 71.0.0 removed the setuptools.extern package and release on 07/18/2024

With this we no longer need to use from setuptools.extern import packaging and we can just import packaging
However depending on the version of 3.10 you may still have 70.3.0 and packaging < 24.0 so we need to navigate around the old and new.

Test Plan

Changelog

Review requests

Risk assessment

@ryanthecoder ryanthecoder force-pushed the fix-setuptools-upgrade-breaking branch from 0f0fb6a to 6b31903 Compare July 19, 2024 16:38
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. If it works I'm all down with it.

@SyntaxColoring
Copy link
Contributor

With this we no longer need to use from setuptools.extern import packaging and we can just import packaging

FYI I do not think packaging is guaranteed to be present. If this works, we're probably relying on it being there because it's a subdependency of some other thing that happens to be installed.

For example, here's what a clean environment looks like:

$ python3 -m venv venv
$ source venv/bin/activate
$ pip freeze --all
pip==21.2.4
setuptools==58.0.4
$ pip install --upgrade setuptools
$ pip freeze --all
pip==21.2.4
setuptools==71.0.3
$ python -c 'import packaging'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'packaging'

I agree that we should merge this if it works.

@ryanthecoder
Copy link
Contributor Author

setuptools >71.0.0 forces the requirement for packaging >=24
https://github.com/pypa/setuptools/blob/5b5dc40b17b9501a6d971fce3101bb033da8eff5/pyproject.toml#L106

@ryanthecoder ryanthecoder merged commit afaa717 into edge Jul 19, 2024
45 checks passed
@SyntaxColoring
Copy link
Contributor

Only with the [core] extra. I don't really understand who is intended to install [core] or when—maybe it's guaranteed for us by Pipenv, but I think my example shows it's not the underlying default, at least.

ryanthecoder added a commit that referenced this pull request Jul 19, 2024
<!--
Thanks for taking the time to open a pull request! Please make sure
you've read the "Opening Pull Requests" section of our Contributing
Guide:


https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests

To ensure your code is reviewed quickly and thoroughly, please fill out
the sections below to the best of your ability!
-->

# Overview
Version 71.0.0 removed the setuptools.extern package and release on
07/18/2024

With this we no longer need to use `from setuptools.extern import
packaging` and we can just `import packaging`
However depending on the version of 3.10 you may still have 70.3.0 and
packaging < 24.0 so we need to navigate around the old and new.
<!--
Use this section to describe your pull-request at a high level. If the
PR addresses any open issues, please tag the issues here.
-->

# Test Plan

<!--
Use this section to describe the steps that you took to test your Pull
Request.
If you did not perform any testing provide justification why.

OT-3 Developers: You should default to testing on actual physical
hardware.
Once again, if you did not perform testing against hardware, justify
why.

Note: It can be helpful to write a test plan before doing development

Example Test Plan (HTTP API Change)

- Verified that new optional argument `dance-party` causes the robot to
flash its lights, move the pipettes,
then home.
- Verified that when you omit the `dance-party` option the robot homes
normally
- Added protocol that uses `dance-party` argument to G-Code Testing
Suite
- Ran protocol that did not use `dance-party` argument and everything
was successful
- Added unit tests to validate that changes to pydantic model are
correct

-->

# Changelog

<!--
List out the changes to the code in this PR. Please try your best to
categorize your changes and describe what has changed and why.

Example changelog:
- Fixed app crash when trying to calibrate an illegal pipette
- Added state to API to track pipette usage
- Updated API docs to mention only two pipettes are supported

IMPORTANT: MAKE SURE ANY BREAKING CHANGES ARE PROPERLY COMMUNICATED
-->

# Review requests

<!--
Describe any requests for your reviewers here.
-->

# Risk assessment

<!--
Carefully go over your pull request and look at the other parts of the
codebase it may affect. Look for the possibility, even if you think it's
small, that your change may affect some other part of the system - for
instance, changing return tip behavior in protocol may also change the
behavior of labware calibration.

Identify the other parts of the system your codebase may affect, so that
in addition to your own review and testing, other people who may not
have the system internalized as much as you can focus their attention
and testing there.
-->
y3rsh pushed a commit that referenced this pull request Jul 22, 2024
<!--
Thanks for taking the time to open a pull request! Please make sure
you've read the "Opening Pull Requests" section of our Contributing
Guide:


https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests

To ensure your code is reviewed quickly and thoroughly, please fill out
the sections below to the best of your ability!
-->

# Overview
Version 71.0.0 removed the setuptools.extern package and release on
07/18/2024

With this we no longer need to use `from setuptools.extern import
packaging` and we can just `import packaging`
However depending on the version of 3.10 you may still have 70.3.0 and
packaging < 24.0 so we need to navigate around the old and new.
<!--
Use this section to describe your pull-request at a high level. If the
PR addresses any open issues, please tag the issues here.
-->

# Test Plan

<!--
Use this section to describe the steps that you took to test your Pull
Request.
If you did not perform any testing provide justification why.

OT-3 Developers: You should default to testing on actual physical
hardware.
Once again, if you did not perform testing against hardware, justify
why.

Note: It can be helpful to write a test plan before doing development

Example Test Plan (HTTP API Change)

- Verified that new optional argument `dance-party` causes the robot to
flash its lights, move the pipettes,
then home.
- Verified that when you omit the `dance-party` option the robot homes
normally
- Added protocol that uses `dance-party` argument to G-Code Testing
Suite
- Ran protocol that did not use `dance-party` argument and everything
was successful
- Added unit tests to validate that changes to pydantic model are
correct

-->

# Changelog

<!--
List out the changes to the code in this PR. Please try your best to
categorize your changes and describe what has changed and why.

Example changelog:
- Fixed app crash when trying to calibrate an illegal pipette
- Added state to API to track pipette usage
- Updated API docs to mention only two pipettes are supported

IMPORTANT: MAKE SURE ANY BREAKING CHANGES ARE PROPERLY COMMUNICATED
-->

# Review requests

<!--
Describe any requests for your reviewers here.
-->

# Risk assessment

<!--
Carefully go over your pull request and look at the other parts of the
codebase it may affect. Look for the possibility, even if you think it's
small, that your change may affect some other part of the system - for
instance, changing return tip behavior in protocol may also change the
behavior of labware calibration.

Identify the other parts of the system your codebase may affect, so that
in addition to your own review and testing, other people who may not
have the system internalized as much as you can focus their attention
and testing there.
-->
y3rsh added a commit that referenced this pull request Jul 22, 2024
…5741)

## `cherry-pick` afaa717

Must update `chore_release-7.4.0` so that Linux app builds work due to a
change in setuptools. To understand the changes see #15717

Co-authored-by: Ryan Howard <[email protected]>
ryanthecoder added a commit that referenced this pull request Nov 15, 2024
<!--
Thanks for taking the time to open a pull request! Please make sure
you've read the "Opening Pull Requests" section of our Contributing
Guide:


https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests

To ensure your code is reviewed quickly and thoroughly, please fill out
the sections below to the best of your ability!
-->

# Overview
Version 71.0.0 removed the setuptools.extern package and release on
07/18/2024

With this we no longer need to use `from setuptools.extern import
packaging` and we can just `import packaging`
However depending on the version of 3.10 you may still have 70.3.0 and
packaging < 24.0 so we need to navigate around the old and new.
<!--
Use this section to describe your pull-request at a high level. If the
PR addresses any open issues, please tag the issues here.
-->

# Test Plan

<!--
Use this section to describe the steps that you took to test your Pull
Request.
If you did not perform any testing provide justification why.

OT-3 Developers: You should default to testing on actual physical
hardware.
Once again, if you did not perform testing against hardware, justify
why.

Note: It can be helpful to write a test plan before doing development

Example Test Plan (HTTP API Change)

- Verified that new optional argument `dance-party` causes the robot to
flash its lights, move the pipettes,
then home.
- Verified that when you omit the `dance-party` option the robot homes
normally
- Added protocol that uses `dance-party` argument to G-Code Testing
Suite
- Ran protocol that did not use `dance-party` argument and everything
was successful
- Added unit tests to validate that changes to pydantic model are
correct

-->

# Changelog

<!--
List out the changes to the code in this PR. Please try your best to
categorize your changes and describe what has changed and why.

Example changelog:
- Fixed app crash when trying to calibrate an illegal pipette
- Added state to API to track pipette usage
- Updated API docs to mention only two pipettes are supported

IMPORTANT: MAKE SURE ANY BREAKING CHANGES ARE PROPERLY COMMUNICATED
-->

# Review requests

<!--
Describe any requests for your reviewers here.
-->

# Risk assessment

<!--
Carefully go over your pull request and look at the other parts of the
codebase it may affect. Look for the possibility, even if you think it's
small, that your change may affect some other part of the system - for
instance, changing return tip behavior in protocol may also change the
behavior of labware calibration.

Identify the other parts of the system your codebase may affect, so that
in addition to your own review and testing, other people who may not
have the system internalized as much as you can focus their attention
and testing there.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants